//
//  HLNetTool.h
//  Magic-C
//
//  Created by 赵五一 on 16/7/13.
//  Copyright © 2016年 赵五一. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^successBlock)(id result);
typedef void(^failureBlock)(NSError *error);

typedef NS_ENUM(NSUInteger, HLResponseStyle) {
    HLJSON,
    HLDATA,
    HLXML,
};
@interface HLNetTool : NSObject

+ (NSURLSessionDataTask *)GET:(NSString *)url
   body:(id)body
 header:(NSDictionary *)headers
response:(HLResponseStyle)responseStyle
successBlock:(successBlock)success
failureBlock:(failureBlock)failure;

+ (NSURLSessionDataTask *)POST:(NSString *)url
   body:(id)body
 header:(NSDictionary *)headers
response:(HLResponseStyle)responseStyle
successBlock:(successBlock)success
failureBlock:(failureBlock)failure;


@end
